package com.thams.junit;

import java.io.File;
import java.io.IOException;
import java.util.List;

import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;

public class CommentTest {
	public static void main(String[] args) throws IOException {
		List<String> strList = FileUtils.readLines(new File("C:/Users/Administrator/Desktop/新建文本文档 (2).html"));
		File javafile = new File("E:/workspace/thams/interfaceGenerater/src/com/thams/entity/SoSomain.java");
		List<String> str2List = FileUtils.readLines(javafile);
		
		for (String string : strList) {
			String[] sdf = StringUtils.split(string, " ");
			String field = sdf[0].trim();
			String chname = sdf[2].trim();
			System.out.print(field+":\t"+chname+"\n");
			for (int i = 0; i < str2List.size(); i++) {
				String string2 = str2List.get(i);
				if(string2.contains("private")&&(string2.toLowerCase().contains(field.toLowerCase()+";")||string2.toLowerCase().contains(field.toLowerCase()+" "))){
					string2 = "/** "+chname+" */" + string2;
				}
				str2List.set(i, string2);
			}
		}
		FileUtils.writeLines(javafile, "UTF-8", str2List);
		
	}
}
